package com.xtedu.examproject.dao.base;

import com.xtedu.examproject.entity.Course;
import com.xtedu.examproject.entity.Subject;
import com.xtedu.examproject.entity.Teacher;
import com.xtedu.examproject.util.PageHelper;

import java.util.List;

public interface CourseDao extends BaseDao<Course>{
    public List<Course> findAll() throws Exception;
    public Course findById(int id) throws Exception;

    PageHelper findAll(int pageindex, int pagesize) throws Exception;

    PageHelper findByRoleIds(int pageindex, int pagesize, int... roleIds) throws Exception;

    public boolean deleteCourseById(int courseId) throws Exception;

    public PageHelper<Course> findPageSelectByRoleId(int pageIndex, int pageSize, int roleId) throws Exception;
    public PageHelper<Course> findPageSelectByCourseName(String courseName, int pageIndex, int pageSize) throws Exception;
    public PageHelper<Course> findPageSelectBySubjectName(String subjectName, int pageIndex, int pageSize) throws Exception;
    public PageHelper<Course> findCoursesByCourseAndSubjectName(String courseName,String subjectName, int pageIndex, int pageSize) throws Exception;
    public boolean updateCourses(Course course) throws Exception;

    public List<Course> findSelectBySubjectName(String subjectName) throws Exception;
    public boolean saveCourseBySort(List<Course> courses);
    public List<Teacher> findCourseByTeacher(int courseId);

    public List<Teacher> findAllTeachers();
    public boolean setCourseTeacher(int courseId, int teacherId);

    public boolean removeTeacherFromCourse(int teacherId, int courseId);

    public List<Course> findBySubjectId(int subjectId) throws Exception;

    public int findCourseIdByStudentId(int studentId) throws Exception;

    public List<Course> findAllCourseIdAndName() throws Exception;
}
